﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QingzimaLogicModel;
using QingzimaDB;
using Jacaranda.Model;

namespace QingzimaScenario
{
    public class YonghuScenario
    {
        public static YonghuLM HuoquByname(string YonghuMing)
        {
            return ConvertToLM(Database.SearchOne<YonghuDB>(new AbstractProperty("YonghuMing") == YonghuMing));
        }
        public static YonghuLM HuoquBymima(string mima)
        {
            return ConvertToLM(Database.SearchOne<YonghuDB>(new AbstractProperty("Mima") == mima));
        }

        private static YonghuLM ConvertToLM(YonghuDB dbModel)
        {
            return dbModel == null ? null : new YonghuLM(dbModel);
        }

    }
}
